package com.naiterui.ehp.bs.weixin.constant;

import com.naiterui.ehp.bp.constants.CommonConstant;

/**
 * 微信小程序常量
 *
 * @author yangfuya
 * @version 1.0
 * @date 2021/5/25 14:18
 **/
public class WeixinMaConstant extends CommonConstant {

    /**
     * TASK任务地址
     */
    public static final String TASK_SCHEDULE_HOST = "schedule.host.url";

    /**
     * 微信小程序消息缓存key
     */
    private static final String WECHAT_MESSAGE_LOCK_PRE = CommonConstant.REDIS_PRE_PT + "WECHAT_MA_MEAASGE_LOCK_";

    /**
     * 微信小程序订阅消息授权的用户
     */
    public static final String WECHAR_MA_SUBSCRIBE = CommonConstant.REDIS_PRE_PT + "wechat_ma_subscribe";

    /**
     * 订阅消息弹出事件
     */
    public static final String SUBSCRIBE_MSG_POPUP_EVENT = "subscribe_msg_popup_event";

    /**
     * 获取微信回调消息锁缓存key
     *
     * @param sign <p>普通消息，sign为消息id ：msgid</p>
     *             <p>时间消息为用户openid加请求时间戳 ： openId_42571352</p>
     * @return /
     */
    public static String getWechatMaMessageLockKey(String sign) {
        return WECHAT_MESSAGE_LOCK_PRE + sign;
    }

    public static class JsonMsgType {
        /**
         * 事件
         */
        public static final String EVENT = "event";
    }
}
